package org.jbch.shittim.utils;

import android.content.Context;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;

public class DBHandler {
	
	private DBHelper helper;
	private SQLiteDatabase db;

	
	public DBHandler(Context ctx) {

		this.helper = new DBHelper(ctx);
		this.db = helper.getWritableDatabase();
		
	}

	public static DBHandler open(Context ctx) throws SQLException{
		
		DBHandler handler = new DBHandler(ctx);
		return handler;
		
		
	}
	
	public void close(){
		helper.close();
	} 

	public SQLiteDatabase getDB(){
		return db;
	}
	
}
